﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace Entity
{
    /// <summary>
    /// 基类 自定义型主键ID
    /// </summary>
    public class BaseEntity<TKey>
    {
        /// <summary>
        /// 主键Id int
        /// </summary>
        [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
        public TKey Id { get; set; }
        public DateTime CreateTime { get; set; } = DateTime.Now;
    }

    /// <summary>
    /// 基类 guid型主键ID
    /// </summary>
    public class BaseEntityInt : BaseEntity<int>
    {
    }
    /// <summary>
    /// 基类 guid型主键ID
    /// </summary>
    public class BaseEntityGuid: BaseEntity<Guid>
    {
    }
}
